package org.dromara.crawler.domain;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Data;
import org.dromara.crawler.config.JSONObjectConverter;

/**
 * 知识模版实体类
 */
@Data
@Entity(name="knowledge_template")
@TableName("knowledge_template")
public class KnowledgeTemplate extends BasicEntity{

    @Id
    @TableId(type= IdType.ASSIGN_ID)
    private Long id;

    private String templateName;

    /**
     * 1 事件模版
     * 2 目标模版
     */
    private String templateType;

    private String templateSecondaryType;

    /**
     * 菜单状态（0正常 1停用）
     */
    private String status;

    /**
     * 资源数据
     */
    @Convert(converter = JSONObjectConverter.class)
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONObject templateConfig;


}
